package controlpoint;

import upnp.controlpoint.core.BrisaControlPoint;
import upnp.event.BrisaControlPointAdapter;
import upnp.event.BrisaControlPointEvent;
import utils.BrisaLogger;

/**
 * 
 * Application example;
 * 
 * @author Thiago Ribeiro
 * @author Wendell Silva
 *
 */
public class SimpleControlPoint {
	
	public static void main(String[] args) {
	
		final BrisaControlPoint cp = new BrisaControlPoint();
		
		cp.addListener(new BrisaControlPointAdapter(){
			
			@Override
			public void searchComplete(BrisaControlPointEvent e) {
				
				cp.printDevices();
			}
			
			@Override
			public void deviceUpdate(BrisaControlPointEvent e) {
				
				cp.printDevices();
			}
			
		});
		
		cp.start();
		BrisaLogger.logger.info("Control Point Address: " + cp.getUrlBase());
		cp.discover();
	}
}
